import request from '@/utils/service'

export default {
  // 获取类型
  async getTypeInfo() {
    return await request({
      url: '/api/orders/type',
      method: 'get'
    })
  },
  // 添加订单
  async addOrders(data) {
    return await request({
      url: '/api/orders/add',
      method: 'post',
      data
    })
  },
  // 获取所有
  async getOrdersInfo(page) {
    return await request({
      url: '/api/orders/getOrdersInfo',
      method: 'get',
      params: page
    })
  },
  // 按照Id获取
  async getOneOrder({ _id }) {
    return await request({
      url: `/api/orders/getOneOrder/${_id}`,
      method: 'get'
    })
  },
  // 修改
  async modifyStart(_id, data) {
    return await request({
      url: `/api/orders/modifyStart/${_id}`,
      method: 'patch',
      data
    })
  }
}
